/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package persistence;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.TableGenerator;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author ceu
 */
@Entity
@Table(name = "type_package")
@NamedQueries({
    @NamedQuery(name = "TypePackage.findAll", query = "SELECT t FROM TypePackage t")})
public class TypePackage implements Serializable {
    private static final long serialVersionUID = 1L;
    
    private Integer idtypePackage;
    @Size(max = 90)
    private String description;
    @Size(max = 45)
    private String type;
       

    public TypePackage() {
    }
    
     public TypePackage(String description, String type) {
         this.description=description;
         this.type=type;
    }

    @TableGenerator(
        name="type_packageGen",
        table="JPA_WXS_APP_SEQUENCE_GENERATOR",
        pkColumnName="GEN_KEY",
        valueColumnName="GEN_VALUE",
        pkColumnValue="idtype_package",
        allocationSize=1,
        initialValue=0)
        @Id
    @GeneratedValue(strategy=GenerationType.TABLE,generator="type_packageGen")
     @Column(name = "idtype_package", nullable = false)
    public Integer getIdtypePackage() {
        return idtypePackage;
    }

    public void setIdtypePackage(Integer idtypePackage) {
        this.idtypePackage = idtypePackage;
    }

    @Column(name = "description")
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Column(name = "type")
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }


    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idtypePackage != null ? idtypePackage.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TypePackage)) {
            return false;
        }
        TypePackage other = (TypePackage) object;
        if ((this.idtypePackage == null && other.idtypePackage != null) || (this.idtypePackage != null && !this.idtypePackage.equals(other.idtypePackage))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "persistence.TypePackage[ idtypePackage=" + idtypePackage + " ]";
    }

    
}
